<!DOCTYPE html>
<html lang="en">
<head>
	 {{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
  .my_order .search input {
    margin-top: 10px;
    padding: 0 10px;
    width: 100px;
    height: 30px;
    border: 1px solid #ddd;
    vertical-align: bottom;
}
</style>
<body class="common-home res layout-home1">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
  {{template "pc/public/head.html" .}}
  {{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<div class="mycapital">
					<div class="header tx-r"><span><!-- 保障账号资产安全 --></span></div>
					<div class="box">
						<dl>
							<dt>
								<h1>我的可用余额</h1>
								<span><em>{{.info.money}}</em></span>
							</dt>
							<dt class="tx-c">
								<a href="/my/recharge">充值</a>
								<a href="/my/getcash">提现</a>
							</dt>
						</dl>
						<div class="my_order clear">
							<ul>
                  <li class="{{if eq $.status ""}}on{{end}} order1"><span><a href="/my/money">全部明细</a></span></li>
                  <li class="{{if eq $.status "0"}}on{{end}} order1"><span><a href="/my/money?status=0">充值明细</a></span></li>
                  <li class="{{if eq $.status "1"}}on{{end}} order1"><span><a href="/my/money?status=1">提现明细</a></span></li>
                  <li class="{{if eq $.status "3"}}on{{end}} order1"><span><a href="/my/money?status=3">消费明细</a></span></li>
                  {{if eq .info.type "2"}}
                  <li class="{{if eq $.status "2"}}on{{end}} order1"><span><a href="/my/money?status=2">分享提成</a></span></li>
                  {{end}}
                  {{if eq .info.type "1"}}
                  <li class="{{if eq $.status "4"}}on{{end}} order1"><span><a href="/my/money?status=4">推广佣金</a></span></li>
                  {{end}}
                  {{if eq .info.isshop 1}}
                  <li class="{{if eq $.status "5"}}on{{end}} order1"><span><a href="/my/money?status=5">店铺收入</a></span></li>
                  {{end}}
              </ul>
                <div class="tx-r search">
                  <form action="/my/money">
                    <input type="text" name="starttime" placeholder="选择开始日期" readonly="" value="{{.starttime}}">
                    <input type="text" name="endtime" placeholder="选择结束日期" readonly="" value="{{.endtime}}">
                    <input class="sub" type="submit" value="搜索">
                  </form>
                </div>
              
              <div class="clear mt-20">
              	<table class="table">
              		<thead>
                      <tr>
                          <th>类别</th>
                          <th>时间</th>
                          <th>金额</th>
                          <th>其他信息</th>
                      </tr>
              		</thead>
                      {{range .list}}
                      <tr>
                        <td>{{if eq .type "0"}}充值余额{{else if eq .type "1"}}余额提现{{else if eq .type "2"}}分销收入{{else if eq .type "3"}}购买商品{{else if eq .type "4"}}推广佣金{{else if eq .type "5"}}店铺收入{{else if eq .type "6"}}退款{{else if eq .type "7"}}店铺退款支出{{else if eq .type "8"}}新人红包{{end}}</td>
                      	<td>{{.addtime}}</td>
                      	<td>{{.money}}</td>
                      	<td>{{if eq .type "3"}}订单:{{range .product}}<a href="/my/order/detail?id={{.id}}">{{.ordernum}}</a><br>{{end}}{{else}}{{.name}}{{end}}</td>
                      </tr>
                      {{end}}
                    </table>
              </div>
            {{if .paginator}}
            {{if ne .paginator.totalpages 1}}
            <div class="pageView">
              <b class="btn">
                {{if ne .paginator.currpage 1}}
                <a href="{{$.url}}page={{.paginator.prevpage}}"><b>&lt;&lt;上一页</b></a>
                {{else}}
                <b>&lt;&lt;上一页</b>
                {{end}}
                {{range $index,$page := .paginator.pages}}
                {{if eq $.paginator.currpage $page}} 
                <b>{{$page}}</b>
                {{else}}
                <a href="{{$.url}}page={{$page}}"><b>{{$page}}</b></a>
                {{end}}
                {{end}}
                <!-- <b class="more">...</b> -->
                {{if eq .paginator.currpage .paginator.totalpages}}
                <b>下一页&gt;&gt;</b>
                {{else}}
                <a href="{{$.url}}page={{.paginator.nextpage}}"><b>下一页&gt;&gt;</b></a>
                {{end}}
              </b>
              <b class="other">
                共{{.paginator.totalpages}}页，到第<input type="text" name="p">页<button id="go">确定</button>
              </b>
            </div>
            {{end}}
            {{end}}
              <!-- <div class="d-tip">提示：系统仅显示您3个月之内的余额明细，更早的余额明细不再显示。</div> -->
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- Footer Container -->
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
</body>
</html>
<script type="text/javascript">
  $('#go').click(function(){
    var totalpages={{.paginator.totalpages}};
    var num=$('input[name="p"]').val()
    if(num<=totalpages){
      window.location.href={{.url}}+`page=`+num
    }
  })
  $("input[name=starttime]").jeDate({
      isinitVal:false,
      festival: false,
      isToday:true, 
      format: 'YYYY-MM-DD'
  });
  $("input[name=endtime]").jeDate({
      isinitVal:false,
      festival: false,
      isToday:true, 
      format: 'YYYY-MM-DD'
  });
</script>
